<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //原型链写上每一步的代码，以及对应的对象是否全等的判断
      //Star 构造函数
      function Star(uname, age, gender) {
        this.uname = uname
        this.age = age
        this.gender = gender
      }
      //new一个实例化对象
      const star = new Star()

      //原型对象
      // star.prototype

      console.log(star.__proto__) //{constructor: ƒ}
      console.log(star.__proto__ === Star.prototype) //true
      console.log(star.__proto__.constructor === Star) //true
      //内置构造函数 Object的原型对象
      console.log(star.__proto__.__proto__)
      console.log(star.__proto__.__proto__ === Object.prototype) //true
      console.log(star.__proto__.__proto__.constructor === Object) //true
    </script>
  </body>
</html>
